//
//  AmountModel.m
//  DebugDemo
//
//  Created by XFB on 2018/11/28.
//  Copyright © 2018年 ZhouCheng. All rights reserved.
//

#import "AmountModel.h"

@implementation AmountModel

+ (NSDictionary *)mj_objectClassInArray
{
    return @{@"objList" : [AmountModel_ObjList class]};
}

- (CGFloat)cellHeight
{
    /// 计算自定义cell的高度 = 组头固定高度60 + cell高度60 * terminalList.count
    CGFloat singleSectionHeaderH = 60;
    CGFloat singleSectionFooterH = 10;
    CGFloat singleSecondAmountCellH = 60;
    
    CGFloat sectionHeaderH = 0;
    for (AmountModel_ObjList *objcListM in self.objList) {
        NSInteger terminalListCount = objcListM.terminalList.count;
        NSInteger height = terminalListCount * singleSectionHeaderH;
        sectionHeaderH = sectionHeaderH + height;
    }
    CGFloat totalCellH =  self.objList.count * (singleSecondAmountCellH + singleSectionFooterH) + sectionHeaderH;
    return totalCellH;
}

- (CGRect)secondTableViewF
{
    CGFloat tableViewX = 0;
    CGFloat tableViewY = 0;
    CGFloat tableViewW = ScreenW;
    CGFloat tableViewH = self.cellHeight;
    return (CGRect){tableViewX, tableViewY, tableViewW, tableViewH};
}

@end


@implementation AmountModel_ObjList

+ (NSDictionary *)mj_objectClassInArray
{
    return @{@"terminalList" : [AmountModel_TerminalList class]};
}

@end


@implementation AmountModel_TerminalList

@end


